package cn.com.bluemoon.daps.sync.core.sync.sql.mysql.datatype.date;

import cn.com.bluemoon.daps.sync.core.sync.sql.mysql.datatype.DataType;

import java.util.Set;

/**
 * YEAR	1 byte	1 byte
 * DATE	3 bytes	3 bytes
 * TIME	3 bytes	3 bytes + fractional seconds storage
 * DATETIME	8 bytes	5 bytes + fractional seconds storage
 * TIMESTAMP
 *
 * @author Jarod.Kong
 * @date 2021/7/22 11:14
 */
public abstract class DateAndTimeDataType implements DataType {
    /**
     * 默认都是加单引号，
     * 特使情况重写
     *
     * @param defaultValue source
     * @return 结果
     */
    @Override
    public Object cast(Object defaultValue) {
        return wrapper(defaultValue, SINGLE_QUOTE);
    }

    /**
     * @return 名称
     */
    @Override
    public Set<String> name() {
        throw new UnsupportedOperationException("不支持获取名称");
    }
}
